package Lambda;

@FunctionalInterface
interface MyinterFaceA {
    void method();
}

@FunctionalInterface
interface MyinterFaceB {
    void method();
}

class test {
    private String name;

    void dosth(MyinterFaceA myinterFace) {
        System.out.print("Function A ");
        myinterFace.method();
    }

    void dosth(MyinterFaceB myinterFace) {
        System.out.print("Function A ");
        myinterFace.method();
    }

    public static void main(String[] args) {
        //这里我们使用自己的函数式接口 输出语句
        test test = new test();
        test.dosth((MyinterFaceA) () -> {
            System.out.print(" do sth");
        });
    }
}
